/* ********************************************************************************************
*  Alvin Baldemeca
*  Tetris Project
*  Course: TCSS 305 , Alan Fowler
*  Term: Spring 2012
*  UNIVERISTY OF WASHINGTON TACOMA
*
*
**********************************************************************************************/

package gui.actions;


import controller.Board;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;


import javax.swing.AbstractAction;
import javax.swing.Action;







/**
 *This action tells a Board to move a tetris piece down.
 *@author Alvin Baldemeca
 * @version 5/25/2012
 */
@SuppressWarnings("serial")
public class DownAction extends AbstractAction
{
  
  /**
   * The panel to perform the action to.
   */
 // private final PowerPaintFrame my_frame;
  private final Board my_board;
  
  /**
   * Constructs a DownAction.
   * @param the_board the tetris board that the action is to control.
   */
  public DownAction(final Board the_board) 
  {
    super("Down");
    putValue(Action.MNEMONIC_KEY, KeyEvent.VK_L);
    putValue(Action.SELECTED_KEY, true);
    my_board = the_board;
  }

  @Override
  public void actionPerformed(final ActionEvent the_event) 
  {
    my_board.step();
  }
  

}
